package cn.jcet.mapreduce.kv;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @author 鲜磊
 * @Date 2020/12/7 22:34
 */
public class KVTextMapper extends Mapper<Text,Text,Text,IntWritable> {

    // 创建value对象
    private IntWritable v  = new IntWritable(1);

    @Override
    protected void map(Text key, Text value, Context context) throws IOException, InterruptedException {

        // 直接写出
        context.write(key,v);
    }
}
